package ca.jerg.data;

import java.io.*;

public interface IErgPoint
{
	/**
	 * Write the data point to the console via standard out.
	 */
	public void write();
	
	
	/**
	 * Write a data point to the buffered character stream.
	 * Typically this is a file constructed via: 
	 * 
	 * <code>
	 * BufferedWriter out = new BufferedWriter(new FileWriter("foo.out"));
	 * </code>
	 * 
	 * but the buffered character stream is not required to be a file.
	 * 
	 * @param out	character stream to write data to
	 * @return		true on success, false otherwise
	 */
	public boolean write( BufferedWriter out );
	
	
	/**
	 * Read a data point from the buffered character stream.
	 * Typically this is a file constructed via:
	 * 
	 * <code>
	 * BufferedReader in = new BufferedReader(new FileReader("foo.in"));
	 * </code>
	 * 
	 * but the buffered character stream is not required to be a file.
	 * 
	 * @param in	character stream to read data from
	 * @return		0 on success, 1 on numeric conversion error, 2 on EOF, 3 on failure
	 */
	public int read( BufferedReader in );
}
